{extend name="index_layout"/}
{block name="main"}
<div class="layui-card">
    <div class="layui-card-header">管理日志</div>
    <div class="layui-card-body">
        <table class="layui-hide" id="currentTable" lay-filter="currentTable" data-auth-delete="{:$auth->check('auth.adminlog/deletelog')}"></table>
    </div>
</div>
{/block}
{block name="script"}
<script>
layui.use('yznTable', function() {
    var table = layui.yznTable;

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTable',
        delete_url: "{:url('deletelog')}",
    };

    table.render({
        init: init,
        toolbar: ['refresh',
            [{
                text: '删除一个月前日志',
                url: init.delete_url,
                method: 'request',
                auth: 'delete',
                icon: 'iconfont icon-trash',
                class: 'layui-btn layui-btn-sm layui-btn-danger',
                extend: 'data-table="currentTable"',
            }]
        ],
        url: '{:url("index")}',
        cols: [
            [
                { field: 'id', width: 80, title: 'ID', sort: true },
                { field: 'uid', width: 80, title: '用户ID' },
                { field: 'info', title: '提示', searchOp: 'like'  },
                { field: 'get', title: '操作URL' },
                { field: 'create_time', width: 180, title: '时间', search: 'range' },
                { field: 'ip', width: 120, title: 'IP' },
                { field: 'status', width: 70,title: '状态',templet: yznTable.formatter.label,selectList:{0:'失败',1:'成功'}},
            ]
        ],
        page: {}
    });

    yznTable.bindevent();
});
</script>
{/block}